package com.landary.parameterrplacement.webservice;

import org.apache.axis.AxisEngine;
import org.apache.axis.AxisFault;
import org.apache.axis.NoEndPointException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.constants.Style;
import org.apache.axis.constants.Use;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.description.ParameterDesc;
import org.apache.axis.soap.SOAPConstants;

import javax.xml.namespace.QName;
import java.net.URL;
import java.rmi.RemoteException;
import java.util.Vector;

/**
 * @author 刘欣
 * @createTime 2023/8/9 16:16
 * @description
 */
public class UUMS_ServiceImplServiceSoapBindingStub extends org.apache.axis.client.Stub implements UUMS_Service {
    private java.util.Vector cachedSerClasses = new Vector();
    private java.util.Vector cachedSerQNames = new Vector();
    private java.util.Vector cachedSerFactories = new Vector();
    private java.util.Vector cachedDeserQNames = new Vector();

    static org.apache.axis.description.OperationDesc[] _operations;

    static {
        _operations = new OperationDesc[15];
        _initOperationDesc1();
        _initOperationDesc2();
    }

    private static void _initOperationDesc1() {
        OperationDesc oper;
        org.apache.axis.description.ParameterDesc param;
        oper = new OperationDesc();
        oper.setName("UUMS_SEND_GetSubPerson_Service");
        param = new ParameterDesc(new QName("", "reqMsg"), ParameterDesc.IN, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new QName("", "return"));
        oper.setStyle(Style.WRAPPED);
        oper.setUse(Use.LITERAL);
        _operations[6] = oper;
    }

    private static void _initOperationDesc2() {
        OperationDesc oper;
        org.apache.axis.description.ParameterDesc param;
        oper = new OperationDesc();
        oper.setName("UUMS_SEND_GetSubDepartment_Service");
        param = new ParameterDesc(new QName("", "reqMsg"), ParameterDesc.IN, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new QName("", "return"));
        oper.setStyle(Style.WRAPPED);
        oper.setUse(Use.LITERAL);
        _operations[14] = oper;
    }

    public UUMS_ServiceImplServiceSoapBindingStub() throws org.apache.axis.AxisFault {
        this(null);
    }

    public UUMS_ServiceImplServiceSoapBindingStub(URL endpointUrl, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
        this(service);
        super.cachedEndpoint = endpointUrl;
    }

    public UUMS_ServiceImplServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
        if (service == null) {
            super.service = new Service();
        } else {
            super.service = service;
        }
        ((org.apache.axis.client.Service) super.service).setTypeMappingVersion("1.2");
    }

    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
        try {
            org.apache.axis.client.Call _call = super._createCall();
            if (super.maintainSessionSet) {
                _call.setMaintainSession(super.maintainSession);
            }
            if (super.cachedUsername != null) {
                _call.setUsername(super.cachedUsername);
            }
            if (super.cachedPassword != null) {
                _call.setPassword(super.cachedPassword);
            }
            if (super.cachedEndpoint != null) {
                _call.setTargetEndpointAddress(super.cachedEndpoint);
            }
            if (super.cachedTimeout != null) {
                _call.setTimeout(super.cachedTimeout);
            }
            if (super.cachedPortName != null) {
                _call.setPortName(super.cachedPortName);
            }
            java.util.Enumeration keys = super.cachedProperties.keys();
            while (keys.hasMoreElements()) {
                String key = (String) keys.nextElement();
                _call.setProperty(key, super.cachedProperties.get(key));
            }
            return _call;
        } catch (java.lang.Throwable t) {
            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", t);
        }
    }


    @Override
    public String UUMS_SEND_GetSubPerson_Service(String reqMsg) throws RemoteException {
        if (super.cachedEndpoint==null){
            throw new NoEndPointException();
        }
        Call _call = createCall();
        _call.setOperation(_operations[6]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(Call.SEND_TYPE_ATTR,Boolean.FALSE);
        _call.setProperty(AxisEngine.PROP_DOMULTIREFS,Boolean.FALSE);
        _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new QName("http://webService.service.avicit.com/","UUMS_SEND_GetSubPerson_Service"));
        setRequestHeaders(_call);
        setAttachments(_call);
        try {
            java.lang.Object _resp = _call.invoke(new java.lang.Object [] {reqMsg});
            if (_resp instanceof RemoteException){
                throw (RemoteException) _resp;
            }else {
                extractAttachments(_call);
                try {
                    return (String) _resp;
                }catch (Exception exception){
                    return (String) org.apache.axis.utils.JavaUtils.convert(_resp,String.class);
                }
            }

        }catch (AxisFault axisFaultException){
            throw axisFaultException;
        }
    }

    @Override
    public String UUMS_SEND_GetSubDepartment_Service(String reqMsg) throws RemoteException {
        if (super.cachedEndpoint==null){
            throw new NoEndPointException();
        }
        Call _call = createCall();
        _call.setOperation(_operations[14]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setEncodingStyle(null);
        _call.setProperty(Call.SEND_TYPE_ATTR,Boolean.FALSE);
        _call.setProperty(AxisEngine.PROP_DOMULTIREFS,Boolean.FALSE);
        _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new QName("http://webService.service.avicit.com/","UUMS_SEND_GetSubDepartment_Service"));
        setRequestHeaders(_call);
        setAttachments(_call);
        try {
            java.lang.Object _resp = _call.invoke(new java.lang.Object [] {reqMsg});
            if (_resp instanceof RemoteException){
                throw (RemoteException) _resp;
            }else {
                extractAttachments(_call);
                try {
                    return (String) _resp;
                }catch (Exception exception){
                    return (String) org.apache.axis.utils.JavaUtils.convert(_resp,String.class);
                }
            }

        }catch (AxisFault axisFaultException){
            throw axisFaultException;
        }
    }
}
